package com.miaow.controller;

/**
 * @author HWZ
 * @date 2023年12月07日 20:04
 * @description
 */
import com.miaow.service.HystrixMovieRecommendationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MovieController {
    private final HystrixMovieRecommendationService movieRecommendationService;

    @Autowired
    public MovieController(HystrixMovieRecommendationService movieRecommendationService) {
        this.movieRecommendationService = movieRecommendationService;
    }

    @GetMapping("/movies")
    public List<String> getRecommendedMovies() {
        return movieRecommendationService.getRecommendedMovies();
    }
}